import Vue from "vue";
import Vuex from "vuex";
import userInfo from "@/store/userInfo";

Vue.use(Vuex);

const store = new Vuex.Store({
  modules: { userInfo },
  state: {
    urlParams: {},
    // 选择的自提点缓存
    selectPickUpPoint: {},
    // 选择的自提点预留信息
    selectPickUpInfo: {},
    // 门票下单缓存
    ticketReserveInfo: {},
    // 结算商品列表
    settlementGoods: [],
    // 活动下单缓存
    activeReserveInfo: {},
    selectAddress: {},
  },
  getters: {},
  actions: {},
  mutations: {
    setUrlParams(state, urlParams) {
      state.urlParams = urlParams;
    },
    SELECT_PICK_UP_POINT(state, point) {
      state.selectPickUpPoint = point;
    },
    SELECT_PICK_UP_INFO(state, point) {
      state.selectPickUpInfo = point;
    },
    TICKET_RESERVE_INFO(state, ticketReserveInfo) {
      state.ticketReserveInfo = ticketReserveInfo;
    },
    ACTIVE_RESERVE_INFO(state, activeReserveInfo) {
      state.activeReserveInfo = activeReserveInfo;
    },
    SELECT_ADDRESS_INFO(state, selectAddress) {
      state.selectAddress = selectAddress;
    },
    setSettlementGoods(state, settlementGoods) {
      state.settlementGoods = settlementGoods;
    },
  },
});

export default store;
